package com.tangcco.lockwell;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.tangcco.lockwell.domain.User;
import com.tangcco.lockwell.domain.UserEventLog;
import com.tangcco.lockwell.repository.UserEventLogMapper;

import com.tangcco.lockwell.repository.UserMapper;
import com.tangcco.lockwell.repository.UserTokenMapper;
import com.tangcco.lockwell.service.UserService;
import com.tangcco.lockwell.service.VocabularyListService;
import com.tangcco.lockwell.viewmodel.admin.user.UserPageRequestVM;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;

import javax.annotation.Resource;
import java.util.List;

@SpringBootTest
class LockwellApplicationTests_yc {

	@Autowired
	private UserMapper userMapper;

	@Autowired
	private UserEventLogMapper userEventLogMapper;

	@Autowired
	private UserTokenMapper userTokenMapper;

	@Autowired
	private UserService userService;

	@Autowired
	private VocabularyListService vocabularyListService;
	@Test
	void contextLoads() {

//
		// 测试分页查询用户信息
//		UserPageRequestVM requestVM = new UserPageRequestVM();
//		requestVM.setPageIndex(1);
//		requestVM.setPageSize(5);
//
//		// 调用 userService.userPage 进行分页查询
//		List<User> userPageInfo = userService.userPage(requestVM);
////
//		System.out.println("userPageInfo = " + userPageInfo);
//		User user=userService.getUserById(5);
//		System.out.println("user = " + user);
//	
//		User user=new User();
//		user.setStatus(1);
//		user.setUserId(5);
//		int num=userService.updateByIdFilter(user);
//		System.out.println("num = " + num);
	}
}

